***  This program constructs summary statistics and graphs for main / appendix

set more off


log using "$log_files/4_summary", replace


******************************************************************
**   A. Download child panel with reasonably aged parents*********
******************************************************************

clear 
use "$data/psid_fam.dta", replace


*Combine HS dropouts and HS graduates into one category for the new educational classification


foreach p in f m {
gen `p'ed_cat_1= 1 if `p'ed_cat==1|`p'ed_cat==2
replace `p'ed_cat_1= 2 if `p'ed_cat==3
replace `p'ed_cat_1= 3 if  `p'ed_cat==4

*Generate a dummy variable for <HS or HS
gen `p'ed_hsd_hs=1-(1-`p'ed_hs)*(1- `p'ed_hsd)

}

label define edg 1 "<HS or HS" 2 "Some coll." 3 "College+"
label values  med_cat_1 edg
label values  fed_cat_1 edg

*Generate dummy variables for <HS or HS and SC or C+
gen med_cat_2=1 if med_cat_1==1
replace med_cat_2=2 if med_cat_1==2|med_cat_1==3

label define edg_2 1 "<HS or HS" 2 "SC or C+"
label values med_cat_2 edg_2


* Create 2-year age groups 
     
gen age_gr=.
replace age_gr=1 if age>=0&age<=2
replace age_gr=2 if age>=3&age<=4 
replace age_gr=3 if age>=5&age<=6 
replace age_gr=4 if age>=7&age<=8
replace age_gr=5 if age>=9&age<=10
replace age_gr=6 if age>=11&age<=12

label define ageg 1 "0-2" 2 "3-4" 3 "5-6" 4 "7-8" 5 "9-10" 6 "11-12"
label values  age_gr ageg

* Compute shares of expenditures in total expenditures

gen totinv = tau_mf_exp + hhinvest + chcare_imp
replace totinv=. if totinv==0

gen hhinv_exp_share = hhinvest/totinv
gen chcare_imp_share = chcare_imp/totinv
gen tau_m_exp_share = tau_m_exp/totinv
gen tau_f_exp_share = tau_f_exp/totinv
gen tau_mf_exp_share = tau_mf_exp/totinv
	

******************************************************************
***********    B. Sample restrictions ***************
******************************************************************

* restrict to those with some measure of investment in CDS_invest_ind
keep if CDS_invest_ind==1

***********    Keep kids ages 5-12   ***************

keep if age>=5 & age<=12

************ Families with only 1 or 2 children ages<=12 ************

keep if num_0_12<=2

************************************ YEAR 2002 *********************************
keep if year==2002


********************************************************************************
***************************** C. SUMMARY STATISTICS ****************************
********************************************************************************

	disp _n(5) "********************************************************************************"
	disp _n(5) "********************************************************************************"
	disp "All children (includes families with zero child care spending (PSID 2002)"
	disp "********************************************************************************"	
	disp _n(5) "********************************************************************************"

	disp _n(5) "********************************************************************************"
	disp " Summary of Expenditures"
	disp "********************************************************************************"	

		
		/////////////////////////////////////////////////////////////////////////////////////
		*** Appendix Figure G-1: Weekly child investment expenditures by mother's education, 
		*** includes families with zero child care spending (PSID 2002) 
		/////////////////////////////////////////////////////////////////////////////////////
		*** Single mothers 

		quietly graph bar tau_m_exp chcare_imp hhinvest if curr_married==0,  /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
			*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) /*
			*/ plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) ylabel(0(50)250, angle(horizontal)) /*
			   title("Single mothers: Investment expenditures by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/bar_graph_single_exp.pdf", as(pdf) replace

		***Two-parent households
				
		quietly graph bar tau_m_exp tau_f_exp  chcare_imp hhinvest if curr_married==1,/*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
					*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")    region(lcolor(white))    rows(2)) ylabel(, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) ylabel(0(100)600, angle(horizontal)) /*
			  title("Two-parent HH: Investment expenditures by mother's education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_married_exp.pdf", as(pdf) replace


		/////////////////////////////////////////////////////////////////////////////////////
		*** Percentage difference in spending on goods and on childcare and in mothers' time investments for all vs. working mothers
		
		*** Goods investments
		egen avg_hhinvest_all = mean(hhinvest)
		egen avg_hhinvest_work = mean(hhinvest) if (pos_hrs_m==1)
		disp "Average spending on goods for all mothers"
		disp avg_hhinvest_all
		disp "Average spending on goods for working mothers"
		disp avg_hhinvest_work
		disp "Percentage difference in spending on goods investments for all vs. working mothers"
		disp 100*(avg_hhinvest_work - avg_hhinvest_all)/avg_hhinvest_all
		
		*** Time investments
		egen avg_tau_m_all = mean(tau_m)
		egen avg_tau_m_work = mean(tau_m) if (pos_hrs_m==1)
		disp "Average time investments for all mothers"
		disp avg_tau_m_all
		disp "Average time investments for working mothers"
		disp avg_tau_m_work
		disp "Percentage difference in mothers' time investments for all vs. working mothers"
		disp 100*(avg_tau_m_work - avg_tau_m_all)/avg_tau_m_all
		
		*** Childcare
		egen avg_chcare_imp_all = mean(chcare_imp)
		egen avg_chcare_imp_work = mean(chcare_imp) if (pos_hrs_m==1)
		disp "Average spending on childcare for all mothers"
		disp avg_chcare_imp_all
		disp "Average spending on childcare for working mothers"
		disp avg_chcare_imp_work
		disp "Percentage difference in spending on childcare for all vs. working mothers"
		disp 100*(avg_chcare_imp_work - avg_chcare_imp_all)/avg_chcare_imp_all
		
		
	disp _n(5) "********************************************************************************"
	disp "Summary Expenditure Shares"
	disp "********************************************************************************"	


		
		/////////////////////////////////////////////////////////////////////////////////////
		*** Appendix Figure G-2: Expenditure shares by mother's education, 
		*** includes families with zero child care spending (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers 
		quietly graph bar tau_m_exp_share chcare_imp_share hhinv_exp_share  if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
					*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))    rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Single mothers: Investment expenditure shares by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/bar_graph_single_share.pdf", as(pdf) replace	
				
			
		***Two-parent households	
		quietly graph bar tau_m_exp_share tau_f_exp_share  chcare_imp_share hhinv_exp_share  if curr_married==1, /*
			*/over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
						*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))    rows(2)) ylabel(0(0.2)1, format(%03.1f)  angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Two-parent HH: Investment expenditure shares by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/bar_graph_married_share.pdf", as(pdf) replace
					


	
	
	
	disp _n(5) "********************************************************************************"
	disp _n(5) "********************************************************************************"
	disp "Children with positive imputed childcare expenditures"
	disp "********************************************************************************"	
	disp _n(5) "********************************************************************************"
	
    *Sample restriction: positive imputed childcare expenditures
   
    keep if pos_chcare_imp==1
	
	
	disp _n(5) "********************************************************************************"
	disp " Summary of Expenditures"
	disp "********************************************************************************"	
	
		/////////////////////////////////////////////////////////////////////////////////////
		*** Figure 1 : Weekly child investment expenditures by child's age (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers 	(color)
		quietly graph bar tau_m_exp  chcare_imp hhinvest if curr_married==0, /*
			*/ over(age_gr) stack /*

			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
						*/ legend( label(1 "Mother's  time")  label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) ylabel(0(100)300, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Single mothers: Investment expenditures by child's age" "2002 PSID",  size(medium)) */
					
			graph export "$graph/fig1a_color.eps", as(eps) replace
			
		*** Single mothers 	(bw)
		quietly graph bar tau_m_exp  chcare_imp hhinvest if curr_married==0, /*
			*/ over(age_gr) stack /*

			*/ bar(1, color(gs6)) bar(2, color(gs11)) bar(3, color(gs0))   /*
						*/ legend( label(1 "Mother's  time")  label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) ylabel(0(100)300, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Single mothers: Investment expenditures by child's age" "2002 PSID",  size(medium)) */
					
			graph export "$graph/fig1a_bw.eps", as(eps) replace

		***Two-parent households (color)
		quietly graph bar tau_m_exp tau_f_exp chcare_imp hhinvest   if curr_married==1,/*
			*/ over(age_gr)stack /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
			*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel(0(100)800, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Two-parent HH: Investment expenditures by child's age" "2002 PSID",  size(medium)) */
					
			graph export "$graph/fig1b_color.eps", as(eps) replace
			
		***Two-parent households (bw)
		quietly graph bar tau_m_exp tau_f_exp chcare_imp hhinvest   if curr_married==1,/*
			*/ over(age_gr)stack /*

			*/ bar(1, color(gs6)) bar(2, color(gs15) lcolor(black)) bar(3, color(gs11)) bar(4, color(gs0))  /*
			*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel(0(100)800, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Two-parent HH: Investment expenditures by child's age" "2002 PSID",  size(medium)) */
					
			graph export "$graph/fig1b_bw.eps", as(eps) replace


			
			
		/////////////////////////////////////////////////////////////////////////////////////
		*** Appendix Figure G-4 : Weekly child investment expenditures by number of children and mother's education (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers 	
		quietly graph bar tau_m_exp  chcare_imp hhinvest if curr_married==0, /*
			*/ over(med_cat_2) /*
			*/ over(num_0_12, relabel(1 "1 child" 2 "2 children")) stack /*
			
			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
						*/ legend( label(1 "Mother's  time")  label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) ylabel(0(100)300, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Single mothers: Investment expenditures by family size and education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_ch_numched_single_exp.pdf", as(pdf) replace

		***Two-parent households
		quietly graph bar tau_m_exp tau_f_exp chcare_imp hhinvest   if curr_married==1,/*
			*/ over(med_cat_2) /*
			*/ over(num_0_12, relabel(1 "1 child" 2 "2 children")) stack /*
			
			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
			*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel(0(100)800, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Two-parent HH: Investment expenditures by family size and education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_ch_numched_married_exp.pdf", as(pdf) replace

		
		
			
		/////////////////////////////////////////////////////////////////////////////////////
		*** Figure 2: Weekly child investment expenditures by mother's education (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers (color)
		quietly graph bar tau_m_exp chcare_imp hhinvest if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
			*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) /* title("Single mothers: Investment expenditures by mother's education" "2002 PSID", size(medium)) */ /*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) ylabel(0(100)400, angle(horizontal)) 
					
			graph export "$graph/fig2a_color.eps", as(eps) replace
			
		*** Single mothers (bw)
		quietly graph bar tau_m_exp chcare_imp hhinvest if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(gs6)) bar(2, color(gs11)) bar(3, color(gs0))   /*
			*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) /* title("Single mothers: Investment expenditures by mother's education" "2002 PSID", size(medium)) */ /*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) ylabel(0(100)400, angle(horizontal)) 
					
			graph export "$graph/fig2a_bw.eps", as(eps) replace
				
		***Two-parent households (color)
		quietly graph bar tau_m_exp tau_f_exp  chcare_imp hhinvest  if curr_married==1,/*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
					*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")    region(lcolor(white))   rows(2)) /*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) ylabel(0(100)600, angle(horizontal)) /* title("Two-parent HH: Investment expenditures by mother's education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/fig2b_color.eps", as(eps) replace

		***Two-parent households (bw)
		quietly graph bar tau_m_exp tau_f_exp  chcare_imp hhinvest  if curr_married==1,/*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(gs6)) bar(2, color(gs15) lcolor(black)) bar(3, color(gs11)) bar(4, color(gs0))   /*
					*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")    region(lcolor(white))   rows(2)) /*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) ylabel(0(100)600, angle(horizontal)) /* title("Two-parent HH: Investment expenditures by mother's education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/fig2b_bw.eps", as(eps) replace		

		

	
	disp _n(5) "********************************************************************************"
	disp "Summary of Expenditure Shares"
	disp "********************************************************************************"	

	

	
		/////////////////////////////////////////////////////////////////////////////////////
		*** Figure 4: Expenditure shares by mother's education (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers (color)	

			
		quietly graph bar tau_m_exp_share chcare_imp_share hhinv_exp_share  if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
					*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Single mothers: Investment expenditure shares by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/fig4a_color.eps", as(eps) replace
			
		*** Single mothers (bw)	

			
		quietly graph bar tau_m_exp_share chcare_imp_share hhinv_exp_share  if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack   /*

			*/ bar(1, color(gs6)) bar(2, color(gs11)) bar(3, color(gs0))   /*
					*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")  region(lcolor(white))   rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Single mothers: Investment expenditure shares by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/fig4a_bw.eps", as(eps) replace
				
			
		*** Two-parent households (color)
			
		quietly graph bar tau_m_exp_share tau_f_exp_share  chcare_imp_share hhinv_exp_share  if curr_married==1, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
						*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel(0(0.2)1, format(%03.1f)  angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Two-parent HH: Investment expenditure shares by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/fig4b_color.eps", as(eps) replace	
			
		*** Two-parent households (bw)	
			
		quietly graph bar tau_m_exp_share tau_f_exp_share  chcare_imp_share hhinv_exp_share  if curr_married==1, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*

			*/ bar(1, color(gs6)) bar(2, color(gs15) lcolor(black)) bar(3, color(gs11)) bar(4, color(gs0))   /*
						*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel(0(0.2)1, format(%03.1f)  angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Two-parent HH: Investment expenditure shares by mother's education" "2002 PSID", size(medium)) */
					
			graph export "$graph/fig4b_bw.eps", as(eps) replace
			
			
			
		
		/////////////////////////////////////////////////////////////////////////////////////
		*** Appendix Figure G-3: Expenditure shares by child's age (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers		

				
		quietly graph bar tau_m_exp_share chcare_imp_share hhinv_exp_share  if curr_married==0, /*
			*/ over(age_gr) stack /*
			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
							*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")   region(lcolor(white))   rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Single mothers: Investment expenditures shares by child's age" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_ch_age_single_share.pdf", as(pdf) replace
				
		*** Two-parent households	
		quietly graph bar tau_m_exp_share tau_f_exp_share  chcare_imp_share hhinv_exp_share  if curr_married==1,/*
			*/ over(age_gr) stack /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
								*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*   title("Two-parent HH: Investment expenditures shares by child's age" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_ch_age_married_share.pdf", as(pdf) replace
			
			
			
			
		/////////////////////////////////////////////////////////////////////////////////////
		*** Appendix Figure G-5: Expenditure shares by number of children and mother's education (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers					
		quietly graph bar tau_m_exp_share chcare_imp_share hhinv_exp_share  if curr_married==0, /*
			*/ over(med_cat_2) /*
			*/ over(num_0_12, relabel(1 "1 child" 2 "2 children")) stack /*
			*/ bar(1, color(navy)) bar(2, color(dkorange)) bar(3, color(dkgreen))   /*
							*/ legend( label(1 "Mother's time") label(2  "Childcare") label(3 "HH goods")   region(lcolor(white))   rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Single mothers: Investment expenditures shares by family size and education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_ch_numched_single_share.pdf", as(pdf) replace
				
		*** Two-parent households	
		quietly graph bar tau_m_exp_share tau_f_exp_share  chcare_imp_share hhinv_exp_share  if curr_married==1,/*
			*/ over(med_cat_2) /*
			*/ over(num_0_12, relabel(1 "1 child" 2 "2 children")) stack /*

			*/ bar(1, color(navy)) bar(2, color(eltblue)) bar(3, color(dkorange)) bar(4, color(dkgreen))   /*
								*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  label(3  "Childcare") label(4 "HH goods")   region(lcolor(white))   rows(2)) ylabel( 0(0.2)1, format(%03.1f) angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*   title("Two-parent HH: Investment expenditures shares by family size and education" "2002 PSID",  size(medium)) */
					
			graph export "$graph/bar_graph_ch_numched_married_share.pdf", as(pdf) replace

			
			
	disp _n(5) "********************************************************************************"
	disp "Summary of time investment in hours"
	disp "********************************************************************************"	

		

		/////////////////////////////////////////////////////////////////////////////////////
		*** Figure 3: Weekly investment hours by mother's education (PSID, 2002)
		/////////////////////////////////////////////////////////////////////////////////////

		*** Single mothers (color)	

		quietly gen fake_bar=0 //generate fake zero variable to build a graph comparable to two-parent households

		quietly graph bar tau_m fake_bar if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*
			*/ bar(1, color(navy)) bar(2, color(white))   /*
			*/ legend( label(1 "Mother's  time") label(2 " ") region(lcolor(white))   rows(2)) ylabel(0(5)15, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Single mothers: Weekly hours with children" "by mother's education, 2002 PSID", size(medium)) */
					
			graph export "$graph/fig3a_color.eps", as(eps) replace
			
		quietly drop fake_bar
			
		*** Two-parent households (color)			
		quietly graph bar tau_m tau_f if curr_married==1, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*

			*/ bar(1, color(navy)) bar(2, color(eltblue))    /*
			*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  region(lcolor(white))   rows(2)) ylabel(0(5)25 , angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Two-parent HH: Weekly hours with children" "by mother's education, 2002 PSID", size(medium)) */
					
			graph export "$graph/fig3b_color.eps", as(eps) replace
			

		*** Single mothers (bw)

		quietly gen fake_bar=0 //generate fake zero variable to build a graph comparable to two-parent households

		quietly graph bar tau_m fake_bar if curr_married==0, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*
			*/ bar(1, color(gs6)) bar(2, color(white))   /*
			*/ legend( label(1 "Mother's  time") label(2 " ") region(lcolor(white))   rows(2)) ylabel(0(5)15, angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /* title("Single mothers: Weekly hours with children" "by mother's education, 2002 PSID", size(medium)) */
					
			graph export "$graph/fig3a_bw.eps", as(eps) replace
			
		quietly drop fake_bar
			
		*** Two-parent households (bw)		
		quietly graph bar tau_m tau_f if curr_married==1, /*
			*/ over(med_cat_1, relabel(1 "<HS or HS" 2 "Some coll." 3 "College+")) stack  /*

			*/ bar(1, color(gs6)) bar(2, color(gs15) lcolor(black))    /*
			*/ legend( label(1 "Mother's  time") label(2 "Father's  time")  region(lcolor(white))   rows(2)) ylabel(0(5)25 , angle(horizontal))/*
			*/plotregion(fcolor(white)) bgcolor(white)  graphregion(fcolor(white) ilcolor(white) lcolor(white)) /*  title("Two-parent HH: Weekly hours with children" "by mother's education, 2002 PSID", size(medium)) */
					
			graph export "$graph/fig3b_bw.eps", as(eps) replace


	
	
log close

	
	
	
